// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode 

package net.minecraft.src;


// Referenced classes of package net.minecraft.src:
//			Item, Block, BlockBed, EntityPlayer, 
//			MathHelper, World, ItemStack

public class LF_ItemFurniture extends Item
{
	public LF_BlockFurnitureBase block;

	public LF_ItemFurniture(int i, LF_BlockFurnitureBase blk)
	{
		super(i);
		block = blk;
	}

	@Override
	public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
	{
		if(l != 1)
			return false;

		j++;
		int m = MathHelper.floor_double((double)((entityplayer.rotationYaw * 4F) / 360F) + 0.5D) & 3;

		if(m == 0)
			m = 2;
		else if(m == 1)
			m = 1;
		else if(m == 2)
			m = 3;
		else if(m == 3)
			m = 0;

		if(!block.canPlaceBlockWithMetaAt(world, i, j, k, m))
			return false;

		block.onItemUse(world, i, j, k, m, entityplayer);
		itemstack.stackSize--;
		return true;
	}
}
